<?php
	$include='
		<link rel="stylesheet" type="text/css" href="'.W_ROOT.'/css/mStyle.css">
		<script src="'.W_ROOT.'/js/jquery.js" type="text/javascript"></script>
	';
	$start = '';
	$error = isset($_GET['error'])?$_GET['error']:'';
	
	$editRow="SELECT tblpharmacy.contact, tbluser.id, tbluser_profile.first_name AS fname, tbluser_profile.last_name AS lname, tbluser.user_pass AS upass, tbluser.email AS uemail, tbluser_profile.phone AS uphone , tbluser_profile.mobile AS umobile, tbluser_profile.address AS uaddress, tbluser.country_id, pharmacy_name, pharmacy_image, tblpharmacy.province_id AS province, tblpharmacy.email AS pemail, tblpharmacy.phone AS pphone, tblpharmacy.address AS paddress, fax, website, license, zip,city,region 
FROM tbluser
INNER JOIN tbluser_profile ON tbluser.id = tbluser_profile.provider
INNER JOIN tblpharmacy ON tblpharmacy.user_id = tbluser.id
WHERE tblpharmacy.shorturl='".$seller."'";
	$query=mysql_query($editRow);
	
	$result=mysql_fetch_array($query);
	$success = isset($_GET['success'])?$_GET['success']:'';	
?>

<script>		
		$(document).ready(function() {	
			$(".b").attr("disabled", "disabled");
		})
		function editSeller(){
			$(".b").removeAttr("disabled");
			$('#btnEditSeller').replaceWith('<input type="submit" value="Update your Profile" name="edit" class="btn btn-warning" />');
		}
</script>
<?php 
//edit
//	$editRow="SELECT * FROM tbluser INNER JOIN tblcountries ON tbluser.id=tblcountries.id INNER JOIN tbluser_profile ON tbluser_profile.provider=tbluser.id where tbluser.id=".$_SESSION['acc_id'];
//	$query=mysql_query($editRow);
//	
//	$result=mysql_fetch_array($query);
//	//print_r($result);die();

$on_map = $result['paddress'].', Cambodia';
$shows = $string = str_replace(' ', '+', $on_map);
			
?>
        <div style="margin-right: 15px;">
        
        <div class="block-header">
            <h4 class="catehome" style="padding: 8px 0 20px 20px;">Contact Us</h4>
        </div>
    <?php
		if($success!=""){
	?>	
		<div align="center"><strong style="color:#F00;"><?php echo $success;?></strong></div>
	<?php
	}
	?>
          <?php
           if(!empty($userlogin))	
            {
                ?>
                <a class="btn right" href="<?php echo W_ROOT; ?>/seller/?p=edit_seller">Edit your Profile</a>
          <?php
            } 
            ?>
                
       <!--<table style="width:100%">                    
                 <tr>
                     <td>
                       <iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=<?php echo $shows;?>&amp;z=13&amp;iwloc=A&amp;output=embed"></iframe>  
                     </td>
                 </tr>
       </table>-->
        <div class="clear"></div>
        
        	<table style="width:100%">                    
                 <tr height="60">
                	<td colspan="3">
                    	<div style="margin-top:30px;"><span style="color:#417EFB; font-size:18px;">Company Infomation</span></div>
                    </td>
                </tr>
                <tr>
                	<td style='width:150px'><i class="icon-home"></i> Address<?php echo $start;?></td>
                    <td  style='width:1px;'>:</td>
                    <td><?php echo $result['paddress']; ?></td>
                </tr>
                
                <tr>
                	<td><i class="icon-home"></i> Company Name<?php echo $start;?></td>
                    <td>:</td>
                    <td><?php echo $result['pharmacy_name']?></td>
                </tr>             

                 <tr>
                	<td><i class="icon-thumbs-up"></i> Phone<?php echo $start;?></td>
                    <td>:</td>
                    <td><?php echo $result['pphone']; ?></td>
                </tr>
                 <tr>
                	<td><i class="icon-envelope"></i> Fax</td>
                    <td>:</td>
                    <td><?php echo $result['fax']; ?></td>
                </tr>
                 <tr>
                	<td><i class="icon-envelope"></i> Email<?php echo $start;?></td>
                    <td>:</td>
                    <td><?php echo $result['pemail']; ?></td>
                </tr>
                 <tr>
                	<td><i class="icon-globe"></i> Website</td>
                    <td>:</td>
                    <td><a href="<?php echo W_ROOT.'/'.$seller ?>" title="<?php echo W_ROOT.'/'.$seller ?>"><?php echo W_ROOT.'/'.$seller ?></a><br/>
                        <?php echo $result['website']; ?></td>
                </tr>
                <tr>
                	<td>License<?php echo $start;?></td>
                    <td>:</td>
                    <td><?php echo $result['license']; ?></td>
                </tr>
                <tr>
                	<td colspan="3">
                    <?php echo $result['contact']?>
                            <?php
                            if(!empty($userlogin))	
                             {
                                
                               if(!empty($urlb[2])){
                                if($urlb[2]=='addmore')	
                                 {
                                     
                                 ?>
                            
                            <script type="text/javascript" src="<?php echo W_ROOT;?>/jscripts/tiny_mce/tiny_mce.js"></script>
                            <script type="text/javascript">
            tinyMCE.init({
                            // General options
                            mode : "textareas",
                            theme : "advanced",
                            plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
                            

                            // Theme options
                            theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
                            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                            //theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                            //theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
                            theme_advanced_toolbar_location : "top",
                            theme_advanced_toolbar_align : "left",
                            theme_advanced_statusbar_location : "bottom",
                            theme_advanced_resizing : true,

                            // Skin options
                            skin : "o2k7",
                            skin_variant : "silver",

                            // Example content CSS (should be your site CSS)
                            content_css : "css/example.css",

                            // Drop lists for link/image/media/template dialogs
                            template_external_list_url : "js/template_list.js",
                            external_link_list_url : "js/link_list.js",
                            external_image_list_url : "js/image_list.js",
                            media_external_list_url : "js/media_list.js",
                            extended_valid_elements :  "iframe[src|width|height|name|align]",

        // Replace values for the template plugin
                            template_replace_values : {
                                    username : "Some User",
                                    staffid : "991234"
                            }
});
</script>
                            
                                <form method="post" action="<?php echo W_ROOT;?>/company/function.php">
                                   <textarea name="s_contact" style="height:350px;"><?php echo $result['contact']?></textarea>
                                   <input style="margin-top: 10px" class="btn right" type="submit" name="sub_s_contact" value="Save" />
                                </form>

                                <?php
                                 }
                             }
                                 else
                                 {
                                     ?>
                                     <a class="btn right" href="<?php echo W_ROOT.'/'.$seller ?>?contact&onecolums&addmore">Add / Edit detail</a>
                                 <?php
                                 }
                             }
                             ?>
                        </td>
                </tr>
                <tr>
                	<td></td>
                    <td></td>
                    <td>                    	
                    </td>
                </tr>
            </table>
	</div><!--<div class="box">-->
        
      